<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%-- 
******************************************************************************
 * Copyright(c) 2007
 *
 * This software is the proprietary information of *.
 * Use is subject to license and non-disclosure terms.
 ******************************************************************************
 
*******************************************************************
 * Name: messages.jsp
 *
 * Purpose: This jsp is used for displaying Struts Messages from action classes
  ********************************************************************
 
 ** 
  *****************************************************************************************
  *                                   Modification Log
  *  Date       Developer              CR#            Description of Change
  *****************************************************************************************
  * 04/13/2007  Tom Shang      QA        Initial Code 
  *
  --%>
    <jsp:include page="publicnotice.jsp"/>
    <div id="messagebar" align="left" style="display:none;background-color:#F4F8FC;">
        <div id="errorzone" style="display:none">
            <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
                <tr>
                    <td class="redtext" align="left">
                        <div id="errorcontent">
                            <html:errors/>
                        </div>
                    </td>
                </tr>
            </table>
        </div>    
        <div id="messagezone" align="left" style="display:none;background-color:#F4F8FC;">
            <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
                <tr>
                    <td class="message">
                        <div id="messagecontent" style="font-color:blue;">
                                  <logic:messagesPresent message="true">  
                                       <html:messages id="messages" message="true">
                                            <li><bean:write name="messages"/></li>
                                       </html:messages>
                                  </logic:messagesPresent> 
                        </div><hr>
                    </td>
                </tr>   
            </table>
        </div>
    </div>    
    <script language="Javascript" type="text/javascript">
        try
        {
            var messageBarDiv = document.getElementById("messagebar");
            var errorZoneDiv = document.getElementById("errorzone");
            var messageZoneDiv = document.getElementById("messagezone");
            
            var errorContentDiv = document.getElementById("errorcontent");
            
            var messageContentDiv = document.getElementById("messagecontent");
            
            var errorHtmlContent = errorContentDiv.innerHTML;
            var messageHtmlContent = messageContentDiv.innerHTML;
            
            if(errorHtmlContent == null)errorHtmlContent = "";
            if(messageHtmlContent == null)messageHtmlContent = "";
            if(errorHtmlContent.length > 0)
            {
                    messageBarDiv.style.display = "block";
                    errorZoneDiv.style.display = "block";
                    errorContentDiv.style.display = "block";
            }
            if(messageHtmlContent.length > 0)
            {
                    messageBarDiv.style.display = "block";
                    messageZoneDiv.style.display = "block";
                    messageContentDiv.style.display = "block";                
            }
         }
         catch(err)
         {
            alert(err.description);
         }
    </script>